export function getHour(time:any) {
  const hh = Math.floor(time / 60 / 60);
  const mm = Math.floor((time - hh * 60 * 60) / 60);
  const ss = Math.floor(time - hh * 60 * 60 - mm * 60);
  return `${hh.toString().padStart(2, '0')}:${mm.toString().padStart(2, '0')}:${ss.toString().padStart(2, '0')}`;
}
 export function timeStringToSeconds(timeString:any) {
    // 使用正则表达式分割时间字符串
   
   let list = timeString.split(':');
   if(list.length==2){
    const minutes = parseInt(list[0], 10);
    const seconds = parseInt(list[1], 10);
    return  minutes * 60 + seconds;
   }else{
    const hours = parseInt(list[0], 10);
    const minutes = parseInt(list[1], 10);
    const seconds = parseInt(list[2], 10);
    return  hours * 60 * 60 + minutes * 60 + seconds;
   }
    // 分别获取小时、分钟和秒
    // const hours = parseInt(parts[1], 10);
  
    // 计算总秒数
  }